<template>
	<view :class="[primarySize()]">
		<view class="container">
			<view class="page-head">
				<hx-navbar ref="hxnb" :config="config"></hx-navbar>
			</view>
			<image src="https://job.nyfesco.com/uploads/20250619/ae60ab4f916549d6b900f552bdeb9ac8.png" mode="aspectFill" class="top_bg"></image>
			<view class="box">
				<view style="transform: translateY(-55rpx);">
					<view class="avatar">
						<image :src="detailInfo.logo_image" mode="aspectFill"></image>
					</view>
					<view class="box-title">{{detailInfo.name}}</view>
					<view class="item-1-left-1">
						<view class="br-1">{{detailInfo.company_type_name}}</view>
						<view class="br-2">{{detailInfo.industry_category_name}}</view>
						<view class="br-3">{{detailInfo.company_scale_name}}</view>
					</view>
				</view>

			</view>
		</view>

		<view class="map" >
			<image class="img" src="/static/public/map-2.png" mode=""></image>
			<view class="desc" @click="openMap">
				<view class="desc-1">
					<image class="img" src="/static/public/address-1.png" mode=""></image>
					<view class="title">{{detailInfo.address}}</view>
				</view>
				<image class="right" src="/static/public/right.png" mode=""></image>
			</view>
		</view>
		<view style="height: 10rpx;width: 100%;background-color: #F6F7FA;">

		</view>
		<view class="detail">
			<view class="icon-show">
				<image src="/static/public/cicle-2.png"></image>
				<view class="title">岗位列表</view>
			</view>
			<view class="zhiwei">
				<view class="zhiwei-item" v-for="v in detailInfo.jobs" :key="item.id">
					<view class="item-1">
						<view class="name">{{v.title}}</view>
						<view class="gongiz">{{v.salary}}</view>
					</view>
					<view class="item-2">
						<view class="tag" v-for="item in 1" :key="item">学历要求: {{v.education_level_name}}</view>
					</view>
					<view class="item-3">
						{{v.descr}}
					</view>
				</view>
			</view>

			<view class="icon-show" style="padding: 40rpx 0;">
				<image src="/static/public/cicle-2.png"></image>
				<view class="title">公司简介</view>
			</view>
			<view class="descript">
				{{detailInfo.intro}}
			</view>

		</view>
	</view>
</template>

<script>
	const app = getApp();
	export default {
		data() {
			return {

				config: {
					color: '#000',
					back: true,
					title: '企业详情',
					//背景颜色;参数一：透明度（0-1）;参数二：背景颜色（array则为线性渐变，string为单色背景）
					backgroundColor: [0, ['#000', '#000']],
					slideBackgroundColor: [1, 'var(--primary)'],
					statusBarFontColor: ['#000000', '#000000']
				},
				detailInfo: {},
			}
		},
		// onPageScroll(e) {
		// 	// 重点，用到滑动切换必须加上
		// 	this.$refs.hxnb.pageScroll(e);
		// },

		/**
		 * 生命周期函数--监听页面加载
		 */
		onLoad: function(options) {
			this.getDetail(options.id)
		},
		/**
		 * 生命周期函数--监听页面卸载
		 */
		onUnload: function() {},
		methods: {
			getDetail(company_id) {
				this.$core.get({
					url: 'xilujob.third/getLiveCompanyDetail',
					data: {
						company_id
					},
					loading: true,
					success: ret => {
						console.log(ret);
						this.detailInfo = ret.data
					}
				});
			},
			openMap() {
				console.log(213);
				if (this.detailInfo.latitude && this.detailInfo.longitude) {
					uni.openLocation({
						latitude: +this.detailInfo.latitude,
						longitude: +this.detailInfo.longitude,
						success: function() {
							console.log('success');
						}
					});
				}
			},
		}
	}
</script>

<style lang="scss" scoped>
	.container {
		min-height: unset;
		padding-bottom: 12rpx;
		background-color: #F6F7FA;
	}

	.top_bg {
		width: 750rpx;
		height: 378rpx;

	}


	.box {
		padding: 40rpx;
		padding-bottom: 32rpx;
		padding-top: 0;
		position: relative;
		z-index: 2;
		background: #fff;
		border-radius: 30rpx 30rpx 0rpx 0rpx;
		width: 100%;
		margin-top: -60rpx;
		height: 200rpx;

		.avatar {
			width: 110rpx;
			height: 110rpx;
			border-radius: 50%;
			border: 4rpx solid #FFFFFF;
			overflow: hidden;

			image {
				width: 100%;
				height: 100%;
			}

		}

		.box-title {
			font-family: PingFang SC, PingFang SC;
			font-weight: 700;
			font-size: 30rpx;
			color: #333333;
			padding: 20rpx 0;
		}

		.item-1-left-1 {
			display: flex;
			font-family: PingFang SC, PingFang SC;
			font-weight: 400;
			font-size: 28rpx;
			color: #AAAAAA;

			.br-1 {
				padding-right: 16rpx;
				position: relative;

				&::after {
					position: absolute;
					content: '';
					height: 50%;
					width: 1rpx;
					background-color: #E5E5E5;
					right: 0;
					top: 50%;
					transform: translateY(-50%);

				}

			}

			.br-2 {
				padding: 0 16rpx;
				position: relative;

				&::after {
					position: absolute;
					content: '';
					height: 50%;
					width: 1rpx;
					background-color: #E5E5E5;
					right: 0;
					top: 50%;
					transform: translateY(-50%);

				}
			}

			.br-3 {
				padding-left: 16rpx;
			}

		}
	}

	.map {
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		overflow: hidden;
		opacity: 0.75;
		margin-top: 8rpx;
		padding: 24rpx;
		position: relative;

		.img {
			width: 100%;
			height: 120rpx;
			border: 2rpx solid #EFEFEF;
		}

		.desc {
			position: absolute;
			width: 70%;
			background: #FFFFFF;
			border-radius: 8rpx 8rpx 8rpx 8rpx;
			top: 50%;
			left: 50%;
			transform: translate(-50%, -50%);
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding: 14rpx 16rpx 12rpx 30rpx;

			.right {
				width: 30rpx;
				height: 30rpx;
			}

			.desc-1 {
				display: flex;
				align-items: center;
				flex: 1;

				.img {
					width: 24rpx;
					height: 24rpx;
				}

				.title {
					font-family: PingFang SC, PingFang SC;
					font-weight: 400;
					font-size: 24rpx;
					color: #666666;
					padding-left: 24rpx;
					flex: 1;
				}
			}
		}
	}

	.detail {
		padding: 40rpx;

		.icon-show {
			display: flex;
			align-items: center;

			image {
				width: 20rpx;
				height: 20rpx;
			}

			.title {
				font-family: PingFang SC, PingFang SC;
				font-weight: 700;
				font-size: 32rpx;
				color: #000000;
				margin-left: 24rpx;
			}
		}

		.zhiwei {


			.zhiwei-item {
				padding: 30rpx 0;
				border-bottom: 1rpx solid #EDEDED;

				.item-1 {
					display: flex;
					justify-content: space-between;
					align-items: center;

					.name {
						font-family: PingFang SC, PingFang SC;
						font-weight: 500;
						font-size: 32rpx;
						color: #000000;
					}

					.gongiz {
						font-family: PingFang SC, PingFang SC;
						font-weight: 500;
						font-size: 28rpx;
						color: #F63F0E;
					}
				}

				.item-2 {
					display: flex;
					margin-top: 24rpx;
					flex-wrap: wrap;

					.tag {
						padding: 12rpx 16rpx;
						margin-right: 16rpx;
						margin-bottom: 16rpx;
						background: #F2F4F8;
						border-radius: 8rpx 8rpx 8rpx 8rpx; 
						font-family: PingFang TC, PingFang TC;
						font-weight: 400;
						font-size: 24rpx;
						color: #727C90;
					}
				}

				.item-3 {
					padding-top: 8rpx;
					font-family: PingFang SC, PingFang SC;
					font-weight: 400;
					font-size: 28rpx;
					color: #6C6C6C;
					text-align: left;
					white-space: pre-wrap;
				}
			}
		}

		.descript {
			font-family: PingFang SC, PingFang SC;
			font-weight: 400;
			font-size: 28rpx;
			color: #6C6C6C;
			text-align: left;
			white-space: pre-wrap;
		}
	}
</style>